<?php

/**
 *  @FileComment            [文件注释内容模板]
 *  @ProjectName             项目名称：shopFrame
 *  @FileName                   文件名称：OrderOrderListGoodsViewModel.class.php
 *  @Author                       yuerengui <596580041@qq.com>
 *  @Date                          2014-10-21 12:16:20
 *  *
 */
class OrderOrderListGoodsViewModel extends ViewModel {

        public $table = 'orderinfo';
        public $view = array(
            'orderinfo' => array('_type' => 'INNER'),
            'order_list' => array('_type' => 'INNER', '_on' => '__orderinfo__.oid=order_list.order_oid'),
            'goods' => array('_type' => 'INNER', '_on' => '__goods__.gid=order_list.goods_gid')
        );

        public function get_data($uid = NULL, $order = NULL, $limit = NULL) {
                return $this->where(array('user_uid' => $uid))->order($order)->limit($limit)->all();
        }

        public function get_all_data($where = null) {
                return $this->order('olid desc')->where($where)->all();
        }

        public function get_statu_count_data($where) {
                return $this->where($where)->count();
        }

}
